package com.design.components;

import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;

import com.data.IdManager;
import com.design.DesignManager;

public class Menu extends DesignComponent implements AttributeTypes {
	
	//**************************************************************************************************
	//	Constructor.
	//**************************************************************************************************
			
	public Menu() {
		super(IdManager.MENU_PREFIX);
		this.entries = new ArrayList <Integer> ();
	}
	
	//**************************************************************************************************
	//	Attributes.
	//**************************************************************************************************
	
	public static byte quantity;
	private List <Integer> entries;
	
	//**************************************************************************************************
	//	Public Methods.
	//**************************************************************************************************

	@Override
	public void dumpAttributes(List <String> names, List <String> values) {
		super.dumpCommonAttributes(names, values);
		Iterator <Integer> i = entries.iterator();
		int id = -1;
		for (; i.hasNext();) {
			id = i.next();
			names.add("Entry " + id);
			values.add(DesignManager.getDesignManager().getComponent(id).getName());
		}
	}
	
	@Override
	public void keepAttributes(List<String> values) {
		
	}
	
	//**************************************************************************************************
	//	Getters & Setters.
	//**************************************************************************************************
	
	public void setEntries(List <Integer> entries) {
		this.entries = entries;
	}
	
	public List <Integer> getEntries() {
		return entries;
	}
}